'''
@Author: your name
@Date: 2020-01-09 15:33:21
@LastEditTime : 2020-01-09 17:56:28
@LastEditors  : Please set LastEditors
@Description: In User Settings Edit
@FilePath: \IntelligentElderlyCare\server\register\buss_mis\operation_record_register.py
'''
from ...pao_python.pao.service.data.mongo_db import N
from ...service.security_module import SecurityModule, FunctionName, PermissionName
from ...service.buss_mis.user_relation_ship import UserRelationShipService
# -*- coding: utf-8 -*-
'''
人员关系管理注册
'''


def register(jsonrpc, db_addr, db_port, db_name, db_user, db_pwd, inital_password, session):
    user_relation_ship_func = UserRelationShipService(
        db_addr, db_port, db_name, db_user, db_pwd, inital_password, session)

    @jsonrpc.method('IUserRelationShipService.get_user_relation_ship_list')
    def __get_user_relation_ship_list(condition, page=None, count=None):
        res = user_relation_ship_func.get_user_relation_ship_list(
            condition, page, count)
        return res

    @jsonrpc.method('IUserRelationShipService.update_user_relation_ship')
    def __update_user_relation_ship(data):
        res = user_relation_ship_func.update_user_relation_ship(data)
        return res

    @jsonrpc.method('IUserRelationShipService.delete_user_relation_ship')
    def __delete_user_relation_ship(ids):
        res = user_relation_ship_func.delete_user_relation_ship(ids)
        return res

    @jsonrpc.method('IUserRelationShipService.get_relationShip_type')
    def __get_relationShip_type(condition, page=None, count=None):
        res = user_relation_ship_func.get_relationShip_type(condition, page=None, count=None)
        return res
